home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-10-21 | 56.2 KB | 2,013 lines |
- Newsgroups: comp.sources.misc
- From: jsp@Princeton.EDU (James Plank)
- Subject: v23i099: jgraph - A filter for plotting postscript graphs, Patch06a/2
- Message-ID: <csm-v23i099=jgraph.221519@sparky.IMD.Sterling.COM>
- X-Md4-Signature: af0f6492b2d72ff8e258c1cfd716f715
- Date: Tue, 22 Oct 1991 03:18:08 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: jsp@Princeton.EDU (James Plank)
- Posting-number: Volume 23, Issue 99
- Archive-name: jgraph/patch06a
- Environment: UNIX, VMS, postscript
- Patch-To: jgraph: Volume 16, Issue 20
-
- This is the first part of a two part patch which brings jgraph to
- version 6.0.
-
- Jgraph takes the description of a graph or graphs in the standard
- input, and produces a postscript file on the standard output. Jgraph
- is ideal for plotting any mixture of scatter point graphs, line
- graphs, and/or bar graphs, and embedding the output into LaTeX, or
- any other text processing system which can read postscript.
-
- The graph description language is simple enough to get nice looking
- graphs with a minimum of effort, yet powerful enough to give the user
- the flexibility to tailor the appearance of the graph to his or her
- individual preferences. This includes plotting multiple graphs and
- laying them out separately on the page (or pages).
-
- The program is written in C, and shouldn't take anything too fancy
- or machine-dependent. It has been tested on DECstations,
- sun3's, and sparc's (and is being used on many other types
- of machines).
-
- Jgraph is available via anonymous ftp to princeton.edu, in the
- file jgraph.Z. This file is a compressed shell bundle file.
-
- Please send me comments and/or bug reports.
-
- Jim Plank
- jsp@princeton.edu
- --------------
- #!/bin/sh
- # This is a shell archive (produced by shar 3.49)
- # To extract the files from this archive, save it to a file, remove
- # everything above the "!/bin/sh" line above, and type "sh file_name".
- #
- # existing files will NOT be overwritten unless -c is specified
- #
- # This is part 1 of a multipart archive
- # do not concatenate these parts, unpack them in order with /bin/sh
- #
- # This shar contains:
- # length mode name
- # ------ ---------- ------------------------------------------
- # 1957 -rw-rw-r-- PATCH.6.README
- # 78625 -rw-rw-r-- patch.6
- #
- if test -r _shar_seq_.tmp; then
- echo 'Must unpack archives in sequence!'
- echo Please unpack part `cat _shar_seq_.tmp` next
- exit 1
- fi
- # ============= PATCH.6.README ==============
- if test -f 'PATCH.6.README' -a X"$1" != X"-c"; then
- echo 'x - skipping PATCH.6.README (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting PATCH.6.README (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'PATCH.6.README' &&
- Version 6.0 Of jgraph is finished.
- X
- For those that don't know, jgraph is a program which
- takes the description of a graph or graphs in the standard
- input, and produces a postscript file on the standard output. Jgraph
- is ideal for plotting any mixture of scatter point graphs, line
- graphs, and/or bar graphs, and embedding the output into LaTeX, or
- any other text processing system which can read postscript.
- X
- There is a mailing list for jgraph users to which I periodically
- send minor bug fixes. Since the last patch to comp.sources.misc,
- jgraph has gone through the following revisions:
- X
- 5.1: Fixed a bug in hash label precisions.
- 5.2: Made the man page more universally readable,
- X Added some files to make life easier for VMS users.
- 5.3: Added more linetypes: dotdash, longdash, etc, as
- X well as a general linetype mechanism. Also put
- X exit(0) into the code.
- 5.4: Added a newpage command for multi-page graphs.
- 5.5: Added clipping, so that points outside the axes
- X don't get printed. Updated the first line of
- X output to the more general "%!PS-Adobe-2.0 EPSF-1.2"
- 6.0: Added arrowheads on curve lines.
- X Added the ability to do grids.
- X Added a bbox command for the user to specify a bounding box.
- X Added gray scale on axes and lines.
- X
- If you'd like to be on the jgraph bug fix list, please
- send me email. And please let me know of bug reports,
- suggestions and comments.
- X
- The most recent version of jgraph is always available
- via anonymous ftp from princeton.edu in the file pub/jgraph.Z.
- This is a compressed shell file. To unpack it, first
- get it using ftp (first type "binary" before doing the get),
- and then do "zcat jgraph.Z | sh".
- X
- The patch in the file patch.6 is from revision 5.0, posted
- to comp.sources.misc in May. If you can't do the ftp
- or get the patch to work, send me email, and I'll mail
- you the sources.
- X
- Take it easy,
- X
- Jim Plank
- jsp@cs.princeton.edu
- 35 Olden Street
- Princeton, NJ 08544-2087
- SHAR_EOF
- chmod 0664 PATCH.6.README ||
- echo 'restore of PATCH.6.README failed'
- Wc_c="`wc -c < 'PATCH.6.README'`"
- test 1957 -eq "$Wc_c" ||
- echo 'PATCH.6.README: original size 1957, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= patch.6 ==============
- if test -f 'patch.6' -a X"$1" != X"-c"; then
- echo 'x - skipping patch.6 (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting patch.6 (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'patch.6' &&
- *** ../work/README Tue Oct 8 17:36:09 1991
- --- README Tue Oct 8 16:55:20 1991
- ***************
- *** 1,3 ****
- --- 1,5 ----
- + $Revision: 6.0 $
- +
- X Jgraph takes the description of a graph or graphs in the standard
- X input, and produces a postscript file on the standard output. Jgraph
- X is ideal for plotting any mixture of scatter point graphs, line
- ***************
- *** 8,14 ****
- X graphs with a minimum of effort, yet powerful enough to give the user
- X the flexibility to tailor the appearance of the graph to his or her
- X individual preferences. This includes plotting multiple graphs and
- ! laying them out separately on the page.
- X
- X The program is written in C, and shouldn't take anything too fancy
- X or machine-dependent. It has been tested on VAX mipsel's and mipseb's,
- --- 10,16 ----
- X graphs with a minimum of effort, yet powerful enough to give the user
- X the flexibility to tailor the appearance of the graph to his or her
- X individual preferences. This includes plotting multiple graphs and
- ! laying them out separately on the page (or pages).
- X
- X The program is written in C, and shouldn't take anything too fancy
- X or machine-dependent. It has been tested on VAX mipsel's and mipseb's,
- ***************
- *** 17,22 ****
- --- 19,32 ----
- X There is a makefile, a man page (in jgraph.1), source code, and
- X example graphs.
- X
- + Jgraph is available via anonymous ftp to princeton.edu, in the
- + file jgraph.Z. This file is a compressed shell bundle file.
- +
- + There is also a mailing list in which I inform users directly
- + about bug fixes. This is for those who don't read comp.sources.misc,
- + or those who would like to hear about minor bug fixes which I
- + haven't posted as a patch to comp.sources.misc.
- +
- X Please send me comments and/or bug reports.
- X
- X Author: Jim Plank
- ***************
- *** 24,31 ****
- X USmail: Department of Computer Science
- X Princeton University
- X 35 Olden St.
- ! Princeton, Nj 08544-2087
- !
- !
- !
- !
- --- 34,37 ----
- X USmail: Department of Computer Science
- X Princeton University
- X 35 Olden St.
- ! Princeton, NJ 08544-2087
- *** ../work/descrip.mms Tue Oct 8 17:36:10 1991
- --- descrip.mms Tue Oct 8 16:55:13 1991
- ***************
- *** 1,10 ****
- ! CC = cc
- !
- X .ifdef DEBUG
- ! CFLAGS=/noopt/debug
- X LFLAGS=/debug
- X .else
- ! CFLAGS=
- X LFLAGS=
- X .endif
- X
- --- 1,15 ----
- ! # VMS MMS makefile
- ! #
- ! # In the link you will get a warning because of the multiple definition
- ! # of exit(). This may be ignored; in order to get MMS completing without
- ! # trouble you will have to call MMS as follows:
- ! # $ MMS/IGNORE
- ! #
- X .ifdef DEBUG
- ! CFLAGS=/INCLUDE=(SYS$DISK:[],SYS$SHARE:)/noopt/debug
- X LFLAGS=/debug
- X .else
- ! CFLAGS=/INCLUDE=(SYS$DISK:[],SYS$SHARE:)
- X LFLAGS=
- X .endif
- X
- ***************
- *** 16,36 ****
- X prio_list.obj, \
- X process.obj, \
- X show.obj, \
- ! token.obj
- X
- X all : jgraph.exe
- X ! done
- X
- ! .SUFFIXES : .jgr .jps .tex .dvi
- !
- ! .jgr.jps :
- ! jgraph < $*.jgr > *.jps
- !
- ! .tex.dvi :
- ! latex $*.tex
- !
- X jgraph.exe : $(OBJS)
- ! link $(LFLAGS) /exe=jgraph $(OBJS)
- X
- X ###
- X draw.obj : draw.c jgraph.h list.h prio_list.h
- --- 21,37 ----
- X prio_list.obj, \
- X process.obj, \
- X show.obj, \
- ! token.obj, \
- ! exit.obj
- X
- X all : jgraph.exe
- X ! done
- X
- ! # Do not link against the shareable image VAXCRTL.EXE, or you will
- ! # miss the reference to the local exit() routine.
- ! # EXIT will be reported as being multiply defined - ignore that.
- X jgraph.exe : $(OBJS)
- ! link $(LFLAGS) /exe=jgraph $(OBJS),sys$library:vaxcrtl/libr
- X
- X ###
- X draw.obj : draw.c jgraph.h list.h prio_list.h
- ***************
- *** 42,44 ****
- --- 43,46 ----
- X process.obj : process.c jgraph.h list.h prio_list.h
- X show.obj : show.c jgraph.h list.h prio_list.h
- X token.obj : token.c list.h
- + exit.obj : exit.c
- *** ../work/draw.c Tue Oct 8 17:36:11 1991
- --- draw.c Tue Oct 8 16:55:14 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/draw.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:08 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/draw.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:43 $
- X * $Author: jsp $
- X */
- X
- ***************
- *** 46,53 ****
- X
- X #define MAXIMUM(a,b) ((a > b) ? a : b)
- X
- ! draw_axis(a)
- ! Axis a;
- X {
- X char orientation;
- X Hash h;
- --- 46,53 ----
- X
- X #define MAXIMUM(a,b) ((a > b) ? a : b)
- X
- ! draw_axis(a, other)
- ! Axis a, other;
- X {
- X char orientation;
- X Hash h;
- ***************
- *** 57,70 ****
- X setlinewidth(1.0);
- X if (a->draw_axis_line) {
- X comment("Drawing Axis");
- X printline(0.0, a->draw_at, a->psize, a->draw_at, orientation);
- X }
- X if (a->draw_hash_marks) {
- X comment("Drawing Hash Marks");
- X for (h = first(a->hash_lines); h != nil(a->hash_lines); h = next(h)) {
- ! printline(h->loc,
- ! a->draw_hash_marks_at,
- ! h->loc,
- X a->draw_hash_marks_at + (h->size * a->hash_scale),
- X orientation);
- X }
- --- 57,69 ----
- X setlinewidth(1.0);
- X if (a->draw_axis_line) {
- X comment("Drawing Axis");
- + printf("gsave %f setgray\n", a->gray);
- X printline(0.0, a->draw_at, a->psize, a->draw_at, orientation);
- X }
- X if (a->draw_hash_marks) {
- X comment("Drawing Hash Marks");
- X for (h = first(a->hash_lines); h != nil(a->hash_lines); h = next(h)) {
- ! printline(h->loc, a->draw_hash_marks_at, h->loc,
- X a->draw_hash_marks_at + (h->size * a->hash_scale),
- X orientation);
- X }
- ***************
- *** 81,90 ****
- --- 80,95 ----
- X draw_label(a->hl);
- X }
- X }
- + if (a->grid_lines) {
- + for (h = first(a->hash_lines); h != nil(a->hash_lines); h = next(h)) {
- + printline(h->loc, 0.0, h->loc, other->psize, orientation);
- + }
- + }
- X if (a->draw_axis_label) {
- X comment("Drawing Axis Label");
- X draw_label(a->label);
- X }
- + printf(" grestore\n");
- X }
- X
- X
- ***************
- *** 96,109 ****
- --- 101,128 ----
- X print_text(l->label, l->x, l->y, l->hj, l->vj, l->rotate, l->font, l->fontsize);
- X }
- X
- + set_clip(g)
- + Graph g;
- + {
- + comment("Setting Clip");
- + printf("newpath\n");
- + printf(" 0 0 moveto 0 %f lineto %f %f lineto %f 0 lineto\n",
- + g->y_axis->psize, g->x_axis->psize,
- + g->y_axis->psize, g->x_axis->psize);
- + printf(" closepath clip newpath\n");
- + }
- +
- X draw_curves(g)
- X Graph g;
- X {
- X Curve c;
- X
- + printf("gsave\n");
- + if (g->clip) set_clip(g);
- X for(c = first(g->curves); c != nil(g->curves); c = next(c)) {
- X draw_curve(c, g);
- X }
- + printf(" grestore\n");
- X }
- X
- X draw_curve(c, g)
- ***************
- *** 112,128 ****
- X {
- X Point p;
- X int i;
- X
- X if (c->linetype != '0') {
- - comment("Drawing Curve Lines");
- -
- X i = 0;
- X for (p = first(c->pts);
- X p != nil(c->pts);
- X p = next(p)) {
- X if (i == 0) {
- ! start_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis),
- ! c->linethick, c->linetype);
- X } else {
- X cont_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis));
- X }
- --- 131,148 ----
- X {
- X Point p;
- X int i;
- + float this_x, this_y, last_x, last_y;
- X
- + printf("gsave %f setgray\n", c->gray);
- + if (c->clip) set_clip(g);
- + comment("Drawing Curve");
- X if (c->linetype != '0') {
- X i = 0;
- X for (p = first(c->pts);
- X p != nil(c->pts);
- X p = next(p)) {
- X if (i == 0) {
- ! start_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis), c);
- X } else {
- X cont_line(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis));
- X }
- ***************
- *** 138,145 ****
- X for (p = first(c->pts);
- X p != nil(c->pts);
- X p = next(p)) {
- ! draw_mark(ctop(p->x, g->x_axis), ctop(p->y, g->y_axis), c, g);
- X }
- X }
- X
- X draw_mark(x, y, c, g)
- --- 158,176 ----
- X for (p = first(c->pts);
- X p != nil(c->pts);
- X p = next(p)) {
- ! this_x = ctop(p->x, g->x_axis);
- ! this_y = ctop(p->y, g->y_axis);
- ! draw_mark(this_x, this_y, c, g);
- ! if (p != first(c->pts)) {
- ! if (c->rarrows)
- ! draw_arrow(this_x, this_y, last_x, last_y, c);
- ! if (c->larrows)
- ! draw_arrow(last_x, last_y, this_x, this_y, c);
- X }
- + last_x = this_x;
- + last_y = this_y;
- + }
- + printf(" grestore\n");
- X }
- X
- X draw_mark(x, y, c, g)
- ***************
- *** 208,213 ****
- --- 239,261 ----
- X }
- X }
- X
- + draw_arrow(x1, y1, x2, y2, c)
- + float x1, y1, x2, y2;
- + Curve c;
- + {
- + float dx, dy;
- +
- + dx = x1 - x2;
- + dy = y1 - y2;
- + if (dx == 0.0 && dy == 0.0) return;
- + printf("gsave %f %f translate %f %f atan rotate\n", x1, y1, dy, dx);
- + start_poly(0.0, 0.0);
- + cont_poly(-(c->asize[0]), (c->asize[1]));
- + cont_poly(-(c->asize[0]), -(c->asize[1]));
- + end_poly(c->fill);
- + printf(" grestore\n");
- + }
- +
- X draw_legend(g)
- X Graph g;
- X {
- ***************
- *** 220,233 ****
- X if (l->type == 'n') return;
- X for (c = first(g->curves); c != nil(g->curves); c = next(c)) {
- X if (c->l->label != CNULL) {
- X y = c->l->y - (c->l->fontsize / 2.0 * FCPI / FPPI);
- X if (l->anylines) {
- ! if (c->linetype != '0') {
- X x = c->l->x - l->midspace - l->linelength;
- ! start_line(x, y, c->linethick, c->linetype);
- X cont_line(x+l->linelength, y);
- X end_line();
- X }
- X x = c->l->x - l->midspace - l->linelength / 2.0;
- X } else x = c->l->x - l->midspace;
- X if (c->marktype == 'X' || c->marktype == 'Y') {
- --- 268,284 ----
- X if (l->type == 'n') return;
- X for (c = first(g->curves); c != nil(g->curves); c = next(c)) {
- X if (c->l->label != CNULL) {
- + printf("gsave %f setgray\n", c->gray);
- X y = c->l->y - (c->l->fontsize / 2.0 * FCPI / FPPI);
- X if (l->anylines) {
- ! if (c->linetype != '0' && l->linelength != 0) {
- X x = c->l->x - l->midspace - l->linelength;
- ! start_line(x, y, c);
- X cont_line(x+l->linelength, y);
- X end_line();
- X }
- + if (c->larrows) draw_arrow(x, y, x+l->linelength, y, c);
- + if (c->rarrows) draw_arrow(x+l->linelength, y, x, y, c);
- X x = c->l->x - l->midspace - l->linelength / 2.0;
- X } else x = c->l->x - l->midspace;
- X if (c->marktype == 'X' || c->marktype == 'Y') {
- ***************
- *** 239,244 ****
- --- 290,296 ----
- X } else {
- X draw_mark(x, y, c, g);
- X }
- + printf("grestore\n");
- X draw_label(c->l);
- X }
- X }
- ***************
- *** 260,267 ****
- X comment("Drawing New Graph");
- X printf("%f %f translate\n", g->x_translate - g->x_axis->psize / 2.0,
- X g->y_translate);
- ! draw_axis(g->x_axis);
- ! draw_axis(g->y_axis);
- X draw_label(g->title);
- X draw_curves(g);
- X draw_legend(g);
- --- 312,325 ----
- X comment("Drawing New Graph");
- X printf("%f %f translate\n", g->x_translate - g->x_axis->psize / 2.0,
- X g->y_translate);
- ! if (g->border) {
- ! printline(0.0, 0.0, 0.0, g->y_axis->psize, 'x');
- ! printline(0.0, 0.0, 0.0, g->x_axis->psize, 'y');
- ! printline(g->x_axis->psize, 0.0, g->x_axis->psize, g->y_axis->psize, 'x');
- ! printline(g->y_axis->psize, 0.0, g->y_axis->psize, g->x_axis->psize, 'y');
- ! }
- ! draw_axis(g->x_axis, g->y_axis);
- ! draw_axis(g->y_axis, g->x_axis);
- X draw_label(g->title);
- X draw_curves(g);
- X draw_legend(g);
- ***************
- *** 271,292 ****
- X
- X }
- X
- ! draw_graphs(gs)
- X Graphs gs;
- X {
- X Graph g;
- X
- ! draw_header(gs);
- ! for (g = first(gs->g); g != nil(gs->g); g = next(g)) {
- ! draw_graph(g);
- X }
- - draw_footer(gs);
- X }
- X
- ! draw_header(gs)
- X Graphs gs;
- X {
- ! printf("%%!\n");
- X printf("%%%%Pages: 0\n");
- X printf("%%%%BoundingBox: %f %f %f %f\n", gs->bb[0], gs->bb[1], gs->bb[2], gs->bb[3]);
- X printf("%%%%EndComments\n");
- --- 329,355 ----
- X
- X }
- X
- ! draw_graphs(gs, pp)
- X Graphs gs;
- + int pp;
- X {
- + Graphs gs_p;
- X Graph g;
- X
- ! for (gs_p = first(gs); gs_p != nil(gs); gs_p = next(gs_p)) {
- ! draw_header(gs_p, pp);
- ! for (g = first(gs_p->g); g != nil(gs_p->g); g = next(g)) {
- ! draw_graph(g);
- ! }
- ! draw_footer(gs_p, pp);
- X }
- X }
- X
- ! draw_header(gs, pp)
- X Graphs gs;
- + int pp;
- X {
- ! printf("%%!PS-Adobe-2.0 EPSF-1.2\n");
- X printf("%%%%Pages: 0\n");
- X printf("%%%%BoundingBox: %f %f %f %f\n", gs->bb[0], gs->bb[1], gs->bb[2], gs->bb[3]);
- X printf("%%%%EndComments\n");
- ***************
- *** 301,307 ****
- X printf("{$F2psEnteredState restore end} def\t%%%%EndProlog\n");
- X printf("$F2psBegin\n");
- X printf("%f 0 translate\n", gs->width / 2.0);
- ! if (gs->printable_postscript)
- X printf("%f %f translate\n",
- X ((8.5 * FCPI) - (gs->bb[2] - gs->bb[0])) / 2.0,
- X (gs->bb[3] > (5.5*FCPI)) ? (11*FCPI) - gs->bb[3] : (5.5*FCPI));
- --- 364,370 ----
- X printf("{$F2psEnteredState restore end} def\t%%%%EndProlog\n");
- X printf("$F2psBegin\n");
- X printf("%f 0 translate\n", gs->width / 2.0);
- ! if (pp)
- X printf("%f %f translate\n",
- X ((8.5 * FCPI) - (gs->bb[2] - gs->bb[0])) / 2.0,
- X (gs->bb[3] > (5.5*FCPI)) ? (11*FCPI) - gs->bb[3] : (5.5*FCPI));
- ***************
- *** 309,317 ****
- X printf("0.700 setlinewidth\n");
- X }
- X
- ! draw_footer(gs)
- X Graphs gs;
- X {
- X printf("$F2psEnd\n");
- ! if (gs->printable_postscript) printf("showpage\n");
- X }
- --- 372,381 ----
- X printf("0.700 setlinewidth\n");
- X }
- X
- ! draw_footer(gs, pp)
- X Graphs gs;
- + int pp;
- X {
- X printf("$F2psEnd\n");
- ! if (pp) printf("showpage\n");
- X }
- *** ../work/edit.c Tue Oct 8 17:36:13 1991
- --- edit.c Tue Oct 8 16:55:14 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/edit.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:11 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/edit.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:44 $
- X * $Author: jsp $
- X */
- X
- ***************
- *** 92,97 ****
- --- 92,99 ----
- X a1->auto_hash_marks = a2->auto_hash_marks;
- X a1->minor_hashes = a2->minor_hashes;
- X a1->hash_scale = a2->hash_scale;
- + a1->gray = a2->gray;
- + a1->grid_lines = a2->grid_lines;
- X a1->precision = a2->precision;
- X a1->start_given = a2->start_given;
- X a1->is_lg = a2->is_lg;
- ***************
- *** 111,116 ****
- --- 113,120 ----
- X copy_axis(g->y_axis, prev(g)->y_axis);
- X g->x_translate = prev(g)->x_translate;
- X g->y_translate = prev(g)->y_translate;
- + g->clip = prev(g)->clip;
- + g->border = prev(g)->border;
- X }
- X
- X edit_curve(c, g)
- ***************
- *** 120,125 ****
- --- 124,130 ----
- X char inp_str[256];
- X float x, y, f;
- X Point p;
- + Flist fl;
- X int i;
- X
- X while ( getstring(inp_str) ) {
- ***************
- *** 182,187 ****
- --- 187,199 ----
- X fprintf(stderr, "\n");
- X exit(1);
- X } else c->marktype = MARKTYPES[i];
- + } else if (strcmp(inp_str, "glines") == 0) {
- + while (getfloat(&f)) {
- + fl = (Flist) get_node (c->gen_linetype);
- + fl->f = f;
- + insert(fl, c->gen_linetype);
- + }
- + rejecttoken();
- X } else if (strcmp(inp_str, "linetype") == 0) {
- X if (!getstring(inp_str)) return;
- X if (strcmp(inp_str, "none") == 0) c->linetype = '0';
- ***************
- *** 188,201 ****
- X else if (strcmp(inp_str, "solid") == 0) c->linetype = 's';
- X else if (strcmp(inp_str, "dotted") == 0) c->linetype = '.';
- X else if (strcmp(inp_str, "dashed") == 0) c->linetype = '-';
- X else {
- X error_header(); fprintf(stderr, "Bad line type: %s\n", inp_str);
- ! error_header(); fprintf(stderr, " Valid marks are %s.\n",
- ! "solid, dottted, dashed, none");
- X exit(1);
- X }
- X } else if (strcmp(inp_str, "linethickness") == 0) {
- X if (!getfloat(&f)) rejecttoken(); else c->linethick = f;
- X } else {
- X rejecttoken();
- X return;
- --- 200,241 ----
- X else if (strcmp(inp_str, "solid") == 0) c->linetype = 's';
- X else if (strcmp(inp_str, "dotted") == 0) c->linetype = '.';
- X else if (strcmp(inp_str, "dashed") == 0) c->linetype = '-';
- + else if (strcmp(inp_str, "longdash") == 0) c->linetype = 'l';
- + else if (strcmp(inp_str, "dotdash") == 0) c->linetype = 'd';
- + else if (strcmp(inp_str, "dotdotdash") == 0) c->linetype = 'D';
- + else if (strcmp(inp_str, "dotdotdashdash") == 0) c->linetype = '2';
- + else if (strcmp(inp_str, "general") == 0) c->linetype = 'g';
- X else {
- X error_header(); fprintf(stderr, "Bad line type: %s\n", inp_str);
- ! error_header(); fprintf(stderr, " Valid marks are %s\n",
- ! "solid, dotted, dashed, longdash, dotdash,");
- ! error_header(); fprintf(stderr, " %s.\n",
- ! "dotdotdash, dotdotdashdash, none");
- X exit(1);
- X }
- X } else if (strcmp(inp_str, "linethickness") == 0) {
- X if (!getfloat(&f)) rejecttoken(); else c->linethick = f;
- + } else if (strcmp(inp_str, "gray") == 0) {
- + if (!getfloat(&f)) rejecttoken(); else c->gray = f;
- + } else if (strcmp(inp_str, "larrows") == 0) {
- + c->larrows = 1;
- + } else if (strcmp(inp_str, "nolarrows") == 0) {
- + c->larrows = 0;
- + } else if (strcmp(inp_str, "rarrows") == 0) {
- + c->rarrows = 1;
- + } else if (strcmp(inp_str, "norarrows") == 0) {
- + c->rarrows = 0;
- + } else if (strcmp(inp_str, "asize") == 0) {
- + if (!getfloat(&f)) rejecttoken();
- + else {
- + c->asize[0] = f;
- + if (!getfloat(&f)) rejecttoken();
- + else c->asize[1] = f;
- + }
- + } else if (strcmp(inp_str, "clip") == 0) {
- + c->clip = 1;
- + } else if (strcmp(inp_str, "noclip") == 0) {
- + c->clip = 0;
- X } else {
- X rejecttoken();
- X return;
- ***************
- *** 336,341 ****
- --- 376,387 ----
- X a->draw_axis_label = 0;
- X } else if (strcmp(inp_str, "draw_axis_label") == 0) {
- X a->draw_axis_label = 1;
- + } else if (strcmp(inp_str, "no_grid_lines") == 0) {
- + a->grid_lines = 0;
- + } else if (strcmp(inp_str, "grid_lines") == 0) {
- + a->grid_lines = 1;
- + } else if (strcmp(inp_str, "gray") == 0) {
- + if ( getfloat(&f)) a->gray = f; else rejecttoken();
- X } else {
- X rejecttoken();
- X return;
- ***************
- *** 427,432 ****
- --- 473,486 ----
- X if (!getfloat(&f)) rejecttoken(); else gs->height = f;
- X } else if (strcmp(inp_str, "X") == 0) {
- X if (!getfloat(&f)) rejecttoken(); else gs->width = f;
- + } else if (strcmp(inp_str, "border") == 0) {
- + g->border = 1;
- + } else if (strcmp(inp_str, "noborder") == 0) {
- + g->border = 0;
- + } else if (strcmp(inp_str, "clip") == 0) {
- + g->clip = 1;
- + } else if (strcmp(inp_str, "noclip") == 0) {
- + g->clip = 0;
- X } else {
- X rejecttoken();
- X return;
- ***************
- *** 437,446 ****
- X edit_graphs(gs)
- X Graphs gs;
- X {
- X char inp_str[80];
- X float f;
- ! int num;
- X
- X while ( getstring(inp_str) ) {
- X if (strcmp(inp_str, "graph") == 0) {
- X if (!getint(&num)) {
- --- 491,502 ----
- X edit_graphs(gs)
- X Graphs gs;
- X {
- + Graphs the_g;
- X char inp_str[80];
- X float f;
- ! int num, i;
- X
- + the_g = first(gs);
- X while ( getstring(inp_str) ) {
- X if (strcmp(inp_str, "graph") == 0) {
- X if (!getint(&num)) {
- ***************
- *** 447,461 ****
- X error_header(); fprintf(stderr, "\"graph\" not followed by number\n");
- X exit(1);
- X }
- ! edit_graph(get_graph(gs->g, num), gs);
- X } else if (strcmp(inp_str, "newgraph") == 0) {
- ! if (first(gs->g) == nil(gs->g))
- ! edit_graph(new_graph(gs->g, 0), gs);
- ! else edit_graph(new_graph(gs->g, last(gs->g)->num + 1), gs);
- X } else if (strcmp(inp_str, "Y") == 0) {
- ! if (!getfloat(&f)) rejecttoken(); else gs->height = f;
- X } else if (strcmp(inp_str, "X") == 0) {
- ! if (!getfloat(&f)) rejecttoken(); else gs->width = f;
- X } else {
- X error_header(); fprintf(stderr, "Bad token: %s\n", inp_str);
- X exit(1);
- --- 503,530 ----
- X error_header(); fprintf(stderr, "\"graph\" not followed by number\n");
- X exit(1);
- X }
- ! edit_graph(get_graph(the_g->g, num), the_g);
- X } else if (strcmp(inp_str, "newgraph") == 0) {
- ! if (first(the_g->g) == nil(the_g->g))
- ! edit_graph(new_graph(the_g->g, 0), the_g);
- ! else edit_graph(new_graph(the_g->g, last(the_g->g)->num + 1), the_g);
- X } else if (strcmp(inp_str, "Y") == 0) {
- ! if (!getfloat(&f)) rejecttoken(); else the_g->height = f;
- X } else if (strcmp(inp_str, "X") == 0) {
- ! if (!getfloat(&f)) rejecttoken(); else the_g->width = f;
- ! } else if (strcmp(inp_str, "newpage") == 0) {
- ! new_graphs(gs);
- ! the_g = last(gs);
- ! } else if (strcmp(inp_str, "bbox") == 0) {
- ! for (i = 0; i < 4; i++) {
- ! if (!getfloat(&f)) {
- ! error_header();
- ! fprintf("Bbox definition must have four numbers\n");
- ! exit(1);
- ! } else {
- ! the_g->bb[i] = f;
- ! }
- ! }
- X } else {
- X error_header(); fprintf(stderr, "Bad token: %s\n", inp_str);
- X exit(1);
- *** /dev/null Tue Oct 8 02:00:06 1991
- --- exit.c Tue Oct 8 16:55:14 1991
- ***************
- *** 0 ****
- --- 1,49 ----
- + /*
- + **++
- + ** FUNCTIONAL DESCRIPTION:
- + **
- + ** Exit is a VMS replacement for the standard Unix exit function
- + **
- + ** FORMAL PARAMETERS:
- + **
- + ** error_code integer passed by value (optional)
- + **
- + ** SIDE EFFECTS:
- + **
- + ** Exit will never return to calling program
- + ** VMS exit status ($STATUS) will be set
- + **--
- + **/
- + #include <varargs.h>
- +
- + exit(va_alist)
- + va_dcl
- + {
- + int nargs;
- + va_list va;
- + int exit_code = 0;
- + /*
- + * Pick up the argument, if present
- + */
- + va_count(nargs);
- + va_start(va);
- + if (nargs > 0) exit_code = va_arg(va,int);
- + /*
- + * Set the VMS $STATUS to the appropriate value:
- + * if exit_code == 0 then $STATUS := success
- + * if exit_code > 0 then $STATUS := error
- + * if exit_code < 0 then $STATUS := severe_error
- + * and perform exit.
- + *
- + * Note:
- + * the %X10000000 added to the actual success/error indicator
- + * will prevent DCL from printing a message.
- + * A 'on error' will be obeyed however.
- + */
- + if (exit_code == 0) /* success */
- + sys$exit(0x10000001);
- + else if (exit_code > 0) /* error */
- + sys$exit(0x10000002);
- + else /* severe error */
- + sys$exit(0x10000004);
- + }
- *** ../work/jgraph.1 Tue Oct 8 17:36:18 1991
- --- jgraph.1 Tue Oct 8 16:55:19 1991
- ***************
- *** 20,52 ****
- X graphs with a minimum of effort, yet powerful enough to give the user
- X the flexibility to tailor the appearance of the graph to his or her
- X individual preferences. This includes plotting multiple graphs and
- ! laying them out separately on the page.
- X .sp
- X As an example, if the user wanted to simply plot the points (2,3),
- X (4,5), (1,6), the following would be enough of a specification file:
- ! .EX
- ! newgraph
- ! newcurve pts 2 3 4 5 1 6
- ! .EE
- X Now, if the user wanted to spruce the graph up by adding labels to
- X the axes, connecting the points, and titling the graph, then the
- X input could change to:
- ! .EX
- ! newgraph
- ! newcurve pts 2 3 4 5 1 6 linetype solid
- ! xaxis label : X axis
- ! yaxis label : Y axis
- ! title : This is an example graph
- ! .EE
- X If the user instead wanted this to be a bar graph with different
- X endpoints on the axes, he/she could simply change the input to:
- ! .EX
- ! newgraph
- ! xaxis min 0 max 5 label : X axis
- ! yaxis min 0 max 6 label : Y axis
- ! newcurve pts 2 3 4 5 1 6 marktype xbar
- ! title : This is an example bar graph
- ! .EE
- X There are many more features of the description language, which are
- X described below in the next section. Features which are not embedded
- X within the description language are: line and function interpolation,
- --- 20,58 ----
- X graphs with a minimum of effort, yet powerful enough to give the user
- X the flexibility to tailor the appearance of the graph to his or her
- X individual preferences. This includes plotting multiple graphs and
- ! laying them out separately on the page (or pages).
- X .sp
- X As an example, if the user wanted to simply plot the points (2,3),
- X (4,5), (1,6), the following would be enough of a specification file:
- ! .PP
- ! .nf
- ! newgraph
- ! newcurve pts 2 3 4 5 1 6
- ! .fi
- ! .PP
- X Now, if the user wanted to spruce the graph up by adding labels to
- X the axes, connecting the points, and titling the graph, then the
- X input could change to:
- ! .PP
- ! .nf
- ! newgraph
- ! newcurve pts 2 3 4 5 1 6 linetype solid
- ! xaxis label : X axis
- ! yaxis label : Y axis
- ! title : This is an example graph
- ! .fi
- ! .PP
- X If the user instead wanted this to be a bar graph with different
- X endpoints on the axes, he/she could simply change the input to:
- ! .PP
- ! .nf
- ! newgraph
- ! xaxis min 0 max 5 label : X axis
- ! yaxis min 0 max 6 label : Y axis
- ! newcurve pts 2 3 4 5 1 6 marktype xbar
- ! title : This is an example bar graph
- ! .fi
- ! .PP
- X There are many more features of the description language, which are
- X described below in the next section. Features which are not embedded
- X within the description language are: line and function interpolation,
- ***************
- *** 110,129 ****
- X character after the ``:'' starts the string, and the next newline
- X character terminates it. Notice that in strings white-space is not
- X ignored. Thus, the string ``Graph #1'' can be denoted as:
- ! .EX
- ! : Graph #1<newline>
- ! .EE
- X or
- ! .EX
- ! :<newline>
- ! Graph #1<newline>
- ! .EE
- X This way of denoting strings allows the user to embed leading and
- X trailing spaces, as well as the null string. For example, the
- X null string ``'' is represented by:
- ! .EX
- ! : <newline>
- ! .EE
- X Once a string has been started, it may contain any character besides
- X a newline. Specifically, it may contain the sequence ``(*'' or
- X ``include'' without starting a comment or including a file.
- --- 116,139 ----
- X character after the ``:'' starts the string, and the next newline
- X character terminates it. Notice that in strings white-space is not
- X ignored. Thus, the string ``Graph #1'' can be denoted as:
- ! .nf
- !
- ! : Graph #1<newline>
- !
- X or
- !
- ! :<newline>
- ! Graph #1<newline>
- !
- ! .fi
- X This way of denoting strings allows the user to embed leading and
- X trailing spaces, as well as the null string. For example, the
- X null string ``'' is represented by:
- ! .nf
- !
- ! : <newline>
- !
- ! .fi
- X Once a string has been started, it may contain any character besides
- X a newline. Specifically, it may contain the sequence ``(*'' or
- X ``include'' without starting a comment or including a file.
- ***************
- *** 204,209 ****
- --- 214,249 ----
- X and
- X \fBX\fR
- X respectively.
- + .TP
- + .B newpage
- + This command is for plotting graphs on multiple pages. After a
- + \fBnewpage,\fR
- + the graphs that the user enters will be plotted on a new page.
- + New graphs and strings will be numbered starting with 0.
- + Essentially,
- + \fBnewpage\fR
- + is the same as appending together the output of separate calls of
- + jgraph on the text before the
- + \fBnewpage,\fR
- + and on the text after the
- + \fBnewpage.\fR
- + \fBNewpage\fR
- + will most likely produce bizarre results if the
- + \fB\-P\fR
- + option is not specified.
- + .TP
- + \fBbbox \fIfloat\fB \fIfloat\fB \fIfloat\fB \fIfloat\fB\fR
- + Jgraph calculates a bounding box for the graph and
- + includes it in the header of the postscript output.
- + For the purposed of LaTeX, this is usually ok, as LaTeX doesn't
- + clip outside of the bounding box. Unfortunately, other programs
- + do clip, and sometimes jgraph doesn't calculate the bounding box
- + too well (text especially screws things up). This command lets
- + the user add his/her own bounding box. The units of this are
- + final postscript units. It's probably best to use the -p option
- + to see what the bounding box is that jgraph produces, and then
- + alter that accordingly with
- + \fBbbox\fR.
- X .PD
- X .RE
- X .LP
- ***************
- *** 263,272 ****
- X is to
- X \fBnewcurve.\fR
- X .TP
- X \fBinherit_axes\fR
- X This lets the user ``inherit'' the values of the last
- X graph's axes. It copies all the attributes of the previous graph's x
- ! and y axes, as well as the x_translate and y_translate values.
- X (Actually, this is a little bit of a lie, as it does not copy the
- X values of the
- X \fB\fIhash_at\fB, \fImhash_at\fB,\fR
- --- 303,336 ----
- X is to
- X \fBnewcurve.\fR
- X .TP
- + \fBborder\fR
- + .br
- + .ns
- + .TP
- + \fBnoborder\fR
- + \fBBorder\fR
- + draws a square border around the area defined by the axes.
- + \fBNoborder\fR
- + specifies no border.
- + \fBNoborder\fR
- + is the default.
- + .TP
- + \fBclip\fR
- + .br
- + .ns
- + .TP
- + \fBnoclip\fR
- + \fBClip\fR
- + specifies that all curves in the graph will be clipped -- that is,
- + no points outside of the of axes will be plotted. Clipping can also be
- + specified on a per-curve basis. The default is
- + \fBnoclip\fR.
- + .TP
- X \fBinherit_axes\fR
- X This lets the user ``inherit'' the values of the last
- X graph's axes. It copies all the attributes of the previous graph's x
- ! and y axes, as well as the x_translate and y_translate values, and the
- ! clipping.
- X (Actually, this is a little bit of a lie, as it does not copy the
- X values of the
- X \fB\fIhash_at\fB, \fImhash_at\fB,\fR
- ***************
- *** 446,451 ****
- --- 510,525 ----
- X \fBdraw_hash_marks,\fR
- X and
- X \fBdraw_hash_labels.\fR
- + .TP
- + \fBgrid_lines\fR
- + .br
- + .ns
- + .TP
- + \fBno_grid_lines\fR
- + \fBGrid_lines\fR
- + specifies to plot a grid line at each (major and minor) hash
- + mark on this axis. The default is
- + \fBno_grid_lines\fR.
- X .PD
- X .RE
- X .LP
- ***************
- *** 490,509 ****
- X option of
- X \fBjgraph\fR
- X .TP
- X \fBfill \|[\fIfloat\fB\|]\fR
- X This sets the filling of marks which define an area
- X to fill (e.g. ``box'', ``circle'', ``xbar''). 1.0 fills the mark with
- X white. 0.0 fills it with black. Anything in between is differing
- X levels of gray. Anything negative fills it with nothing (i.e. makes
- ! it see-through). The default fill can be determined using the
- ! \fB\-p\fR
- ! option of
- ! \fBjgraph.\fR
- X .TP
- X \fBgmarks \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
- X \fBGmarks\fR
- ! is a way for the user to
- ! define custom marks. For each mark on
- X \fB(x,y),\fR
- X Each pair of
- X \fB\|{\fIfloat_x\fB\|}, \|{\fIfloat_y\fB\|}, \fR
- --- 564,584 ----
- X option of
- X \fBjgraph\fR
- X .TP
- + \fBgray \|[\fIfloat\fB\|]\fR
- + This specifies the gray scale in which to draw the curve (i.e. the
- + curve's marks, lines, and arrows). 0.0 (The default) is black.
- + 1.0 is white.
- + .TP
- X \fBfill \|[\fIfloat\fB\|]\fR
- X This sets the filling of marks which define an area
- X to fill (e.g. ``box'', ``circle'', ``xbar''). 1.0 fills the mark with
- X white. 0.0 fills it with black. Anything in between is differing
- X levels of gray. Anything negative fills it with nothing (i.e. makes
- ! it see-through). The default is 0 (black).
- X .TP
- X \fBgmarks \|[\|{\fIfloat\fB\|} \|{\fIfloat\fB\|}\|]*\fR
- X \fBGmarks\fR
- ! is a way for the user to define custom marks. For each mark on
- X \fB(x,y),\fR
- X Each pair of
- X \fB\|{\fIfloat_x\fB\|}, \|{\fIfloat_y\fB\|}, \fR
- ***************
- *** 512,529 ****
- X Thus, for example, the
- X ``box'' mark could be defined as ``\fIgmarks\fB -1 -1 -1 1 1 1 1 -1''.
- X .TP
- X \fBlinetype \|[\fItoken\fB\|]\fR
- ! This defines the type of the line connecting
- ! the points. Valid entries are ``solid'', ``dotted'', ``dashed'', and
- ! ``none''. The default is ``none''. Points are connected in the order in
- ! which they are inserted using the
- X \fBpts\fR
- X command.
- X .TP
- X \fBlinethickness \|[\fIfloat\fB\|]\fR
- X This defines the line thickness (in
- X absolute postscript units) of the connecting line. Default = 1.0.
- X .TP
- X \fBlabel\fR
- X This edits the label of this curve for the purposed of
- X drawing a legend. (see LABEL EDITING COMMANDS and LEGEND EDITING
- --- 587,664 ----
- X Thus, for example, the
- X ``box'' mark could be defined as ``\fIgmarks\fB -1 -1 -1 1 1 1 1 -1''.
- X .TP
- + \fBlarrows\fR
- + .br
- + .ns
- + .TP
- + \fBrarrows\fR
- + .br
- + .ns
- + .TP
- + \fBnolarrows\fR
- + .br
- + .ns
- + .TP
- + \fBnorarrows\fR
- + \fBRarrows\fR
- + specifies to draw an arrow at the end of every line
- + segment in the curve.
- + \fBLarrows\fR
- + specifies to draw an arrow at the beginning of every line segment.
- + The size of the arrows can be changed by using
- + \fBasize\fR.
- + The
- + \fBfill\fR
- + token controls the filling of the head of the arrows.
- + The default is
- + \fBnolarrows\fR
- + and
- + \fBnorarrows\fR.
- + .TP
- + \fBasize \|[\fIfloat\fB\|] \|[\fIfloat\fB\|]\fR
- + This sets the size of the arrows. The first
- + \fB\|[\fIfloat\fB\|] \fR
- + controls the arrow's width. Its units are those of the x-axis.
- + The second
- + \fB\|[\fIfloat\fB\|] \fR
- + controls the arrow's height. It is in the units of the y-axis.
- + Use the -p option of jgraph to see the default values.
- + .TP
- X \fBlinetype \|[\fItoken\fB\|]\fR
- ! This defines the type of the line connecting the points. Valid
- ! entries are ``solid'', ``dotted'', ``dashed'', ``longdash'',
- ! ``dotdash'', ``dotdotdash'', ``dotdotdashdash'', ``general'', and
- ! ``none''. The default is ``none''. ``General'' lets the user define
- ! his own linetype using the
- ! \fBglines\fR
- ! command described below. Points are connected in the
- ! order in which they are inserted using the
- X \fBpts\fR
- X command.
- X .TP
- + \fBglines \|[\fIfloat\fB\|]*\fR
- + This lets the user specify the exact dashing of a line. The format
- + is as in postscript -- the first number is the length of the first
- + dash, the second is the length of the space after the first dash,
- + etc. For example, ``dotdash'' could be defined as ``\fIglines\fB 5 3
- + 1 3''.
- + .TP
- X \fBlinethickness \|[\fIfloat\fB\|]\fR
- X This defines the line thickness (in
- X absolute postscript units) of the connecting line. Default = 1.0.
- X .TP
- + \fBclip\fR
- + This specifies that this curve will be clipped -- that is,
- + no points outside of the of axes will be plotted.
- + .TP
- + \fBnoclip\fR
- + This turns off clipping. If clipping was specified for the
- + entire graph, then
- + \fBnoclip\fR
- + has no effect.
- + \fBNoclip\fR
- + is the default.
- + .TP
- X \fBlabel\fR
- X This edits the label of this curve for the purposed of
- X drawing a legend. (see LABEL EDITING COMMANDS and LEGEND EDITING
- ***************
- *** 694,699 ****
- --- 829,839 ----
- X marks, labels, axes, etc.
- X .RS
- X .TP
- + \fBgray \|[\fIfloat\fB\|]\fR
- + This specifies a gray-scale for drawing the axes (axis lines, hash
- + marks, hash labels and grid lines). The default is 0.0 (black).
- + 1.0 is white.
- + .TP
- X \fBhash_at \|[\fIfloat\fB\|]\fR
- X Draw a hash mark at this point. No label is
- X made for this hash mark.
- ***************
- *** 928,934 ****
- X .SH EMBEDDING THE OUTPUT IN LATEX
- X I haven't read the manuals, but the way I've been loading these files
- X into LaTeX has been as follows:
- ! .EX
- X 1. Toward the beginning of my LaTeX file, I've had ``\\input{psfig}''
- X 2. Where I've wanted my file, I've put:
- X
- --- 1068,1075 ----
- X .SH EMBEDDING THE OUTPUT IN LATEX
- X I haven't read the manuals, but the way I've been loading these files
- X into LaTeX has been as follows:
- ! .PP
- ! .nf
- X 1. Toward the beginning of my LaTeX file, I've had ``\\input{psfig}''
- X 2. Where I've wanted my file, I've put:
- X
- ***************
- *** 943,949 ****
- X 4. If that doesn't work, try dvips-ing the file and printing the postscript,
- X and if that still doesn't work, try doing everything on a sun.
- X
- ! .EE
- X .SH BUGS
- X If the
- X \fBhash_scale \fR
- --- 1084,1091 ----
- X 4. If that doesn't work, try dvips-ing the file and printing the postscript,
- X and if that still doesn't work, try doing everything on a sun.
- X
- ! .fi
- ! .PP
- X .SH BUGS
- X If the
- X \fBhash_scale \fR
- ***************
- *** 953,957 ****
- --- 1095,1106 ----
- X .sp
- X Logarithmic axes cannot contain points <= 0. If I have
- X enough complaints to convince me that this is a bug, I'll try to fix it.
- + .sp
- + If jgraph were really smart, then it would have arrow-heads go to the
- + edge of standard marks like circles, etc. Someday.
- + .sp
- + There is no real way to make the axes such that they decrease from
- + left to right or low to high -- or at least not without writing your
- + own hash labels.
- X .sp
- X There may well be loads of other bugs. Send to jsp@princeton.edu.
- *** ../work/jgraph.c Tue Oct 8 17:36:20 1991
- --- jgraph.c Tue Oct 8 16:55:15 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:13 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:48 $
- X * $Author: jsp $
- X */
- X
- ***************
- *** 47,54 ****
- --- 47,57 ----
- X new_c = (Curve) get_node(c);
- X new_c->num = num;
- X new_c->l = new_label();
- + new_c->clip = 0;
- + new_c->gray = 0.0;
- X
- X new_c->pts = (Point) make_list(sizeof(struct point));
- + new_c->gen_linetype = (Flist) make_list(sizeof(struct flist));
- X new_c->marktype = MARKTYPES[num % NORMALMARKTYPES];
- X new_c->linetype = '0';
- X new_c->linethick = 1.0;
- ***************
- *** 56,64 ****
- X new_c->marksize[1] = FSIG;
- X new_c->general_marks = (Point) make_list(sizeof(struct point));
- X i = num / NORMALMARKTYPES;
- ! if (i == 0) new_c->fill = 0.0;
- ! else if (i == 1) new_c->fill = 1.0;
- ! else new_c->fill = -1.0;
- X prio_insert(new_c, c, 0);
- X return new_c;
- X }
- --- 59,69 ----
- X new_c->marksize[1] = FSIG;
- X new_c->general_marks = (Point) make_list(sizeof(struct point));
- X i = num / NORMALMARKTYPES;
- ! new_c->fill = 0.0;
- ! new_c->rarrows = 0;
- ! new_c->larrows = 0;
- ! new_c->asize[0] = FSIG;
- ! new_c->asize[1] = FSIG;
- X prio_insert(new_c, c, 0);
- X return new_c;
- X }
- ***************
- *** 113,118 ****
- --- 118,125 ----
- X a->auto_hash_marks = 1;
- X a->start_given = 0;
- X a->hash_scale = -1.0;
- + a->grid_lines = 0;
- + a->gray = 0.0;
- X a->is_x = is_x;
- X a->is_lg = 0;
- X a->hash_labels = (String) make_list (sizeof(struct string));
- ***************
- *** 206,211 ****
- --- 213,220 ----
- X g->curves = (Curve) make_list(sizeof(struct curve));
- X g->strings = (String) make_list(sizeof(struct string));
- X g->title = new_title();
- + g->clip = 0;
- + g->border = 0;
- X g->legend = new_legend();
- X /* g->def = new_default(); */
- X prio_insert(g, gs, 0);
- ***************
- *** 222,250 ****
- X return new_g;
- X }
- X
- X main(argc, argv)
- X int argc;
- X char **argv;
- X {
- ! struct graphs gs;
- X int i;
- ! char show;
- X
- X #ifdef VMS
- X IOSTREAM = stdin; /* for token.c -hdd */
- X #endif
- X show = 0;
- ! gs.g = (Graph) make_list(sizeof(struct graph));
- ! gs.height = 0.0;
- ! gs.width = 0.0; /* added -hdd */
- ! gs.printable_postscript = 0;
- ! edit_graphs(&gs);
- ! process_graphs(&gs);
- X for (i = 1; i < argc; i++) {
- X if (strcmp(argv[i], "-p") == 0) show = 1;
- ! else if (strcmp(argv[i], "-P") == 0) gs.printable_postscript = 1;
- X }
- ! if (show) show_graphs(&gs); else draw_graphs(&gs);
- X }
- X
- X
- --- 231,273 ----
- X return new_g;
- X }
- X
- + new_graphs(gs)
- + Graphs gs;
- + {
- + Graphs newg;
- +
- + newg = (Graphs) get_node(gs);
- + newg->g = (Graph) make_list(sizeof(struct graph));
- + newg->height = 0.0;
- + newg->width = 0.0;
- + newg->bb[0] = FSIG; newg->bb[1] = FSIG;
- + newg->bb[2] = FSIG; newg->bb[3] = FSIG;
- + insert(newg, gs);
- + }
- +
- X main(argc, argv)
- X int argc;
- X char **argv;
- X {
- ! Graphs gs;
- X int i;
- ! int show, pp;
- X
- X #ifdef VMS
- X IOSTREAM = stdin; /* for token.c -hdd */
- X #endif
- X show = 0;
- ! pp = 0;
- X for (i = 1; i < argc; i++) {
- X if (strcmp(argv[i], "-p") == 0) show = 1;
- ! else if (strcmp(argv[i], "-P") == 0) pp = 1;
- X }
- ! gs = (Graphs) make_list(sizeof(struct graphs));
- ! new_graphs(gs, pp);
- ! edit_graphs(gs);
- ! process_graphs(gs);
- ! if (show) show_graphs(gs); else draw_graphs(gs, pp);
- ! exit(0);
- X }
- X
- X
- *** /dev/null Tue Oct 8 02:00:06 1991
- --- jgraph.com Tue Oct 8 16:55:15 1991
- ***************
- *** 0 ****
- --- 1,39 ----
- + $! JGRAPH.COM: Execute jgraph on VMS.
- + $ SAVE_VER = 'F$VERIFY( F$TRNLNM( "JGRAPH_VERIFY"))'
- + $ ! How to use this procedure:
- + $ ! (1) define a symbol to execute the command file
- + $ ! $ JGRAPH :== @dev:[directory]JGRAPH.COM
- + $ ! We will assume that both this jgraph.com and jgraph.exe reside
- + $ ! in dev:[directory].
- + $ ! (2) Then, to run the program with say the HYPERCUBE.JGR file,
- + $ ! $ JGRAPH HYPERCUBE ! (Yes you can leave off the .JGR extension)
- + $ ! To generate a stand-alone PostScript file that can be sent directly
- + $ ! to the printer, use:
- + $ ! $ JGRAPH HYPERCUBE "-P"
- + $ ! or simply
- + $ ! $ JGRAPH HYPERCUBE -P
- + $ ! If you really want lowercase to reprint input in expanded form:
- + $ ! $ JGRAPH HYPERCUBE "-p"
- + $ ! The resulting output file will have a ".jps" extension.
- + $!
- + $ ON ERROR THEN GOTO EXIT
- + $ ON CONTROL_Y THEN GOTO EXIT
- + $!
- + $L1:
- + $ P1 = F$SEARCH( F$PARSE( P1, ".JGR"))
- + $ IF P1 .NES. "" THEN GOTO L2
- + $ INQUIRE /LOCAL P1 "Input File : "
- + $ GOTO L1
- + $L2:
- + $ JPS_FILE = F$PARSE( P1,,, "NAME") + ".JPS"
- + $ THIS_FILE = F$ENVIRONMENT("PROCEDURE")
- + $ HERE = F$PARSE(THIS_FILE,,,"DEVICE",) + F$PARSE(THIS_FILE,,,"DIRECTORY",)
- + $ RUN_JGRAPH := $'HERE'JGRAPH
- + $!
- + $ TMP = F$VERIFY( 1)
- + $ RUN_JGRAPH <'p1' >'jps_file' "''P2'"
- + $ $status = $STATUS
- + $ TMP = 'F$VERIFY( TMP)
- + $!
- + $EXIT:
- + $ EXIT $status + 0*F$VERIFY( SAVE_VER)
- *** ../work/jgraph.h Tue Oct 8 17:36:21 1991
- --- jgraph.h Tue Oct 8 16:55:15 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.h,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:46:24 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.h,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:50 $
- X * $Author: jsp $
- X */
- X
- ***************
- *** 28,33 ****
- --- 28,39 ----
- X float y;
- X } *Point;
- X
- + typedef struct flist {
- + struct flist *flink;
- + struct flist *blink;
- + float f;
- + } *Flist;
- +
- X typedef struct label {
- X char *label;
- X float x;
- ***************
- *** 48,56 ****
- --- 54,68 ----
- X Point general_marks;
- X float marksize[2];
- X float fill;
- + float gray;
- X float linethick;
- + Flist gen_linetype;
- X char marktype;
- X char linetype;
- + int rarrows;
- + int larrows;
- + float asize[2];
- + int clip;
- X } *Curve;
- X
- X typedef struct string {
- ***************
- *** 99,104 ****
- --- 111,118 ----
- X float draw_hash_marks_at;
- X float draw_hash_labels_at;
- X float draw_at;
- + float gray;
- + int grid_lines;
- X int draw_hash_labels;
- X int draw_axis_line;
- X int draw_hash_marks;
- ***************
- *** 121,127 ****
- X float size;
- X int anylines;
- X float midspace;
- ! char type; /* 'n' = off, 't' = top, 'r' = right, 'u' = userdefined, 'c' = custom */
- X } *Legend;
- X
- X typedef struct graph {
- --- 135,142 ----
- X float size;
- X int anylines;
- X float midspace;
- ! char type; /* 'n' = off, 't' = top, 'r' = right,
- ! 'u' = userdefined, 'c' = custom */
- X } *Legend;
- X
- X typedef struct graph {
- ***************
- *** 137,151 ****
- X Legend legend;
- X String strings;
- X Label title;
- X Default def;
- X } *Graph;
- X
- X typedef struct graphs {
- X Graph g;
- X float height;
- X float width;
- X float bb[4]; /* Bounding box */
- - char printable_postscript;
- X } *Graphs;
- X
- X extern float ctop();
- --- 152,169 ----
- X Legend legend;
- X String strings;
- X Label title;
- + int clip;
- + int border;
- X Default def;
- X } *Graph;
- X
- X typedef struct graphs {
- + struct graphs *flink;
- + struct graphs *blink;
- X Graph g;
- X float height;
- X float width;
- X float bb[4]; /* Bounding box */
- X } *Graphs;
- X
- X extern float ctop();
- *** ../work/list.c Tue Oct 8 17:36:22 1991
- --- list.c Tue Oct 8 16:55:16 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:14 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:51 $
- X * $Author: jsp $
- X */
- X
- *** ../work/list.h Tue Oct 8 17:36:23 1991
- --- list.h Tue Oct 8 16:55:16 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.h,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:46:26 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/list.h,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:52 $
- X * $Author: jsp $
- X */
- X
- *** ../work/printline.c Tue Oct 8 17:36:25 1991
- --- printline.c Tue Oct 8 16:55:16 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/printline.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:15 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/printline.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:54 $
- X * $Author: jsp $
- X */
- X
- ***************
- *** 21,32 ****
- X printf("newpath %f %f moveto %f %f lineto stroke\nstroke\n",
- X y1, x1, y2, x2);}
- X
- ! start_line(x1, y1, thickness, style)
- ! float x1, y1, thickness;
- ! char style;
- X {
- ! setlinewidth(thickness);
- ! setlinestyle(style);
- X printf("%f %f moveto ", x1, y1);
- X }
- X
- --- 21,32 ----
- X printf("newpath %f %f moveto %f %f lineto stroke\nstroke\n",
- X y1, x1, y2, x2);}
- X
- ! start_line(x1, y1, c)
- ! float x1, y1;
- ! Curve c;
- X {
- ! setlinewidth(c->linethick);
- ! setlinestyle(c->linetype, c->gen_linetype);
- X printf("%f %f moveto ", x1, y1);
- X }
- X
- ***************
- *** 40,46 ****
- X {
- X printf("stroke\n stroke\n");
- X setlinewidth(1.0);
- ! setlinestyle('s');
- X
- X }
- X
- --- 40,46 ----
- X {
- X printf("stroke\n stroke\n");
- X setlinewidth(1.0);
- ! setlinestyle('s', (Flist) 0);
- X
- X }
- X
- ***************
- *** 129,142 ****
- X printf("%f setlinewidth\n", size * LINEWIDTHFACTOR);
- X }
- X
- ! setlinestyle(style)
- X char style;
- X {
- X switch(style) {
- X case '0':
- X case 's': printf("\t[] 0 setdash\n"); break;
- X case '.': printf("\t [1 3.200000] 0 setdash\n"); break;
- X case '-': printf("\t [4.00000] 0 setdash\n"); break;
- X default: fprintf(stderr, "Error: Unknown line type: %c\n", style);
- X exit(1);
- X break;
- --- 129,155 ----
- X printf("%f setlinewidth\n", size * LINEWIDTHFACTOR);
- X }
- X
- ! setlinestyle(style, glist)
- X char style;
- + Flist glist;
- X {
- + Flist fl;
- +
- X switch(style) {
- X case '0':
- X case 's': printf("\t[] 0 setdash\n"); break;
- X case '.': printf("\t [1 3.200000] 0 setdash\n"); break;
- X case '-': printf("\t [4.00000] 0 setdash\n"); break;
- + case 'l': printf("\t [7 2] 0 setdash\n"); break;
- + case 'd': printf("\t [5 3 1 3] 0 setdash\n"); break;
- + case 'D': printf("\t [5 3 1 2 1 3] 0 setdash\n"); break;
- + case '2': printf("\t [5 3 5 3 1 2 1 3] 0 setdash\n"); break;
- + case 'g':
- + printf("\t [");
- + for (fl = first(glist); fl != nil(glist); fl = next(fl))
- + printf("%f ", fl->f);
- + printf("] 0 setdash\n");
- + break;
- X default: fprintf(stderr, "Error: Unknown line type: %c\n", style);
- X exit(1);
- X break;
- *** ../work/prio_list.c Tue Oct 8 17:36:26 1991
- --- prio_list.c Tue Oct 8 16:55:16 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:17 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:55 $
- X * $Author: jsp $
- X */
- X
- *** ../work/prio_list.h Tue Oct 8 17:36:27 1991
- --- prio_list.h Tue Oct 8 16:55:17 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.h,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:46:27 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/prio_list.h,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:56 $
- X * $Author: jsp $
- X */
- X
- *** ../work/process.c Tue Oct 8 17:36:28 1991
- --- process.c Tue Oct 8 16:55:17 1991
- ***************
- *** 1,7 ****
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/process.c,v $
- ! * $Revision: 5.0 $
- ! * $Date: 91/05/02 14:45:18 $
- X * $Author: jsp $
- X */
- X
- --- 1,7 ----
- X /*
- X * $Source: /n/fs/vd/jsp/src/jgraph/RCS/process.c,v $
- ! * $Revision: 6.0 $
- ! * $Date: 91/10/08 16:53:56 $
- X * $Author: jsp $
- X */
- X
- ***************
- *** 141,177 ****
- X Axis a;
- X {
- X int i, b, b2, done;
- ! float x, x2;
- X
- ! x2 = 0.0;
- X b = 0;
- X x = a->hash_interval;
- X
- X done = 0;
- X while(b < 6 && !done) {
- ! i = (int) ((x - x2));
- X x2 = i;
- ! if (x2 - x < .0000001 && x - x2 < .0000001) done = 1;
- X else {
- X b++;
- - x2 *= 10.0;
- X x *= 10.0;
- X }
- X }
- X
- ! x2 = 0.0;
- X b2 = 0;
- X x = a->hash_start;
- X
- X done = 0;
- X while(b2 < 6 && !done) {
- ! i = (int) (x - x2);
- X x2 = i;
- ! if (x2 - x < .0000001 && x - x2 < .0000001) done = 1;
- X else {
- X b2++;
- - x2 *= 10.0;
- X x *= 10.0;
- X }
- X }
- X return MAX(b, b2);
- --- 141,177 ----
- X Axis a;
- X {
- X int i, b, b2, done;
- ! float x, x2, tolerance;
- X
- ! tolerance = 0.000001;
- X b = 0;
- X x = a->hash_interval;
- X
- X done = 0;
- X while(b < 6 && !done) {
- ! i = (int) (x + 0.4);
- X x2 = i;
- ! if (x2 - x < tolerance && x - x2 < tolerance) done = 1;
- X else {
- X b++;
- X x *= 10.0;
- + tolerance *= 10.0;
- X }
- X }
- X
- ! tolerance = 0.000001;
- X b2 = 0;
- X x = a->hash_start;
- X
- X done = 0;
- X while(b2 < 6 && !done) {
- ! i = (int) (x + 0.4);
- X x2 = i;
- ! if (x2 - x < tolerance && x - x2 < tolerance) done = 1;
- X else {
- X b2++;
- X x *= 10.0;
- + tolerance *= 10.0;
- X }
- X }
- X return MAX(b, b2);
- ***************
- *** 323,330 ****
- X if (ABS(t1) >= 1.0 || t1 == 0.0) prec = 0;
- X else {
- X tmp = ABS(t1);
- ! prec = 2;
- ! while(tmp < 0.0) {tmp *= 10.0; prec++;}
- X }
- X }
- X sprintf(s->s->label, "%.*f", prec, t1);
- --- 323,330 ----
- X if (ABS(t1) >= 1.0 || t1 == 0.0) prec = 0;
- X else {
- X tmp = ABS(t1);
- ! prec = -1;
- ! while(tmp < 1.0) {tmp *= 10.0; prec++;}
- X }
- X }
- X sprintf(s->s->label, "%.*f", prec, t1);
- ***************
- *** 441,446 ****
- --- 441,450 ----
- X 4.0 : disttop(c->marksize[0], g->x_axis);
- X c->marksize[1] = (c->marksize[1] == FSIG) ?
- X 4.0 : disttop(c->marksize[1], g->y_axis);
- + c->asize[0] = (c->asize[0] == FSIG) ?
- + 6.0 : disttop(c->asize[0], g->x_axis);
- + c->asize[1] = (c->asize[1] == FSIG) ?
- + 2.0 : disttop(c->asize[1], g->y_axis);
- X }
- X
- X process_curves(g)
- ***************
- *** 470,495 ****
- X process_graphs(gs)
- X Graphs gs;
- X {
- X Graph g;
- X float tmp_x, x, max_y, min_y;
- X
- ! for (g = first(gs->g); g != nil(gs->g); g = next(g)) process_graph(g);
- SHAR_EOF
- true || echo 'restore of patch.6 failed'
- fi
- echo 'End of part 1'
- echo 'File patch.6 is continued in part 2'
- echo 2 > _shar_seq_.tmp
- exit 0
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-